Explicitly remove RUST_LOG when crawling output
authorAlex Crichton <alex@alexcrichton.com>
Thu, 5 Mar 2015 20:11:08 +0000 (12:11 -0800)
committerAlex Crichton <alex@alexcrichton.com>
Thu, 5 Mar 2015 20:11:08 +0000 (12:11 -0800)
Ensure we don't get erroneous information about invalid log levels or such.

Closes #1381

src/cargo/ops/cargo_rustc/context.rs
tests/test_cargo_compile.rs

index 409d1f761d53e8f712826f67af559e7a118e5c5d..f6ec075b793d9c7afde355df6c4a69c1d210131f 100644 (file)
@@ -96,7 +96,8 @@ impl<'a, 'b: 'a> Context<'a, 'b> {
                .arg("--crate-name").arg("_")
                .arg("--crate-type").arg("dylib")
                .arg("--crate-type").arg("bin")
-               .arg("--print=file-names");
+               .arg("--print=file-names")
+               .env_remove("RUST_LOG");
         if let Some(s) = target {
             process.arg("--target").arg(s);
         };
index ae00228211dc3864f74d1a299a6f4b116f750d4f..1023338ed2ac947526596ec34168243fdb02929e 100644 (file)
@@ -1158,7 +1158,9 @@ test!(simple_staticlib {
         "#)
         .file("src/lib.rs", "pub fn foo() {}");
 
-    assert_that(p.cargo_process("build"), execs().with_status(0));
+    // env var is a test for #1381
+    assert_that(p.cargo_process("build").env("RUST_LOG", "nekoneko=trace"),
+                execs().with_status(0));
 });
 
 test!(staticlib_rlib_and_bin {